<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var obj = {
        name: '张三',
        age: 18
    }

    for (let item in obj) {
        console.log(item)
    }

    for (let item of obj) {
        console.log(item)
    }
</script>
</body>
</html>
